Welcome to ‘Basics of GraphQL’. After watching this video, you will be able
to: Describe GraphQL, explain the key characteristics of a GraphQL
API, and explain the benefits of using GraphQL
APIs. GraphQL is a query language for your API. It provides a standard way to allow clients
to request only the data that they need from the API. And it can be developed using any programming
language, as it is language agnostic. GraphQL enables you to retrieve exactly what
you need from the API. This means you don’t receive the data that
you didn’t request. It also means you receive exactly what you
require, even from different resources. Unlike the RESTful API, GraphQL requires just
one endpoint to retrieve everything you require. And as can be seen in this product example, you
only need the name, and that’s what you receive. With REST, your APIs are the resources that
provide endpoints to perform a particular operation using an HTTP method. In GraphQL, the types you define in the schema
are the nodes. With REST, you make multiple calls and receive
whatever is sent by the server. But in GraphQL, you only request and receive
what you require. Extending your GraphQL API doesn’t need
a new version; you add the new fields without breaking the
existing clients, as they were only requesting what they required. A Query is used for querying your data, more
like a GET request in a RESTful API. At its simplest, GraphQL makes requests for
specific fields on objects. A mutation is used for manipulating and modifying
your data. And every field in the mutation type can be thought
of as a POST, PUT, or DELETE request in a RESTful API. Now Netflix is known for its loosely coupled and
highly scalable microservice architecture. Netflix produces original content at an accelerated
pace. From the time a TV show or a movie is pitched
to when it’s available on Netflix, a lot happens behind the scenes. Initially, the relationships between entities
were disparate and existed in various microservices. To address those challenges, the team
started building a curated Graph API called “Studio API”. Its goal is to provide a unified abstraction
on top of data and relationships. In this new design, Studio API is responsible
for schema and resolving queries. So, the Netflix engineering team did not stop
there and went a step ahead with federated architecture, where each team has the
ownership of their respective domains. In this video, you learned that: GraphQL is a language-agnostic query language
for your API, it provides you with exact data,
no more and no less, and it has one endpoint.